package com.smart.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import com.smart.util.DBUtil;

public class PropertyManagementFeeDAO {
  public double getFee(int houseId) throws SQLException
  {
	  double fee=0;
	  Connection conn=DBUtil.getConnection();
	  String sql="select property_management_fee from property_management_fee where house_id=?";
	   PreparedStatement pSt=conn.prepareCall(sql);
	   pSt.setInt(1,houseId);
	   ResultSet rs=pSt.executeQuery();
	   if(rs.next())
	   {
		   fee=rs.getDouble(1);
	   }
	   else
	   {
		   System.out.println("PropertyManagementFeeDAO getFee method error");
	   }
	  return fee;
  }
}
